import require from '@/utils/require'

/**
 * 获取所有文章列表
 * @returns
 */
export const getArticleList = params => {
  return require({
    url: '/article/list',
    params
  })
}

/**
 * 更改文章排名
 * @returns
 */
export const articleSort = data => {
  return require({
    url: '/article/sort',
    method: 'post',
    data
  })
}

/**
 * 删除指定文章
 * @returns
 */
export const deleteArticle = id => {
  return require({
    url: `/article/delete/${id}`
  })
}

/**
 * 获取文章详情
 * @returns
 */
export const articleDetail = id => {
  return require({
    url: `/article/${id}`
  })
}
